﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Web/BizWeb.Master" AutoEventWireup="true" CodeBehind="PrjWizard.aspx.cs" Inherits="FrameWork.web.Web.Project.PrjWizard" %>
<%@ Import Namespace="Slja.BLL" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<link type="text/css" href="../../Js/InputSelect/search_suggest.css"  rel="stylesheet" charset="gb2312" />
<script type="text/javascript" src="../../Js/Prj.js" ></script>
<script type="text/javascript" src="../../Js/DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="../../Js/InputSelect/search_suggest.js" charset="gb2312"></script>
<style type="text/css">
    #wrapper{height:100%;background:#369;}   
    body>#wrapper{height:auto;min-height:100%;} /*设定最小高度*/ 
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">


<div style="width:800px;" >
    <FrameWorkWebControls:HeadMenuWebControls ID="HeadMenuWebControls1" runat="server" HeadTitleTxt="订单填报">              
    </FrameWorkWebControls:HeadMenuWebControls>
 <asp:PlaceHolder runat="server" ID="plhImgbutton">
       <table class="icotble">
            <tr>
                <td align="center" valign="middle"><asp:ImageButton runat="server" ID="imgPrjNew" OnClick="img_Click" ImageUrl="../../Image/proj/dingdantianjia.GIF" CssClass="icoNormal" style="width:55px;height:55px;" onmouseover="MouseOver(this);" onmouseout="MouseOut(this);" /></td>           
            </tr>
            <tr>
                <th align="center"  class="tdNormal">添加订单</th>        
            </tr>
       </table>
        <table class="icotble">
            <tr>         
                <td align="center" valign="middle"><asp:ImageButton runat="server" ID="imgPrjList"  OnClick="img_Click" ImageUrl="../../Image/proj/dingdanliebiao.GIF"  CssClass="icoNormal" onmouseover="MouseOver(this);" onmouseout="MouseOut(this);"  /></td>
            </tr>
            <tr><th align="center" class="tdNormal">订单列表</th>
            </tr>
       </table>      
       </asp:PlaceHolder>
    <%-- <div style="clear:both"></div>--%>
</div>
<%--隐藏域--%>
   <asp:HiddenField runat="server" ID="hdfCurStepIdx" Value="0" />
   <asp:HiddenField runat="server" ID="hdfCityID" />
   <asp:HiddenField runat="server" ID="hdfPrjID"></asp:HiddenField>
<%--隐藏域--%>
<div style="width:800px;" >
<asp:Wizard ID="Wizard1" runat="server" Visible="false">
      <LayoutTemplate>
        <div id="header">            
          <asp:PlaceHolder ID="headerPlaceHolder" runat="server">        
          </asp:PlaceHolder>
        </div>
         <div id="sideBar" class="wizard_step_bar">
            <asp:PlaceHolder ID="sideBarPlaceHolder" runat="server" />
        </div>  
          <div id="WizardStep">
          <asp:PlaceHolder ID="WizardStepPlaceHolder" runat="server">        
          </asp:PlaceHolder>
        </div>        
        <div id="navigation">
          <asp:PlaceHolder ID="navigationPlaceHolder" runat="server" />
        </div>   
      </LayoutTemplate>

      <SideBarTemplate>
        <asp:ListView ID="sideBarList" runat="server">
          <LayoutTemplate>
            <div id="ItemPlaceHolder" runat="server"/>
          </LayoutTemplate>
          <ItemTemplate>
             <asp:LinkButton ID="sideBarButton" runat="server" 
                 Text="Button" />
          </ItemTemplate>
        </asp:ListView>
      </SideBarTemplate>
      <HeaderTemplate> 
      </HeaderTemplate>
      <StepNextButtonStyle CssClass="btnblue1" />
      <StepPreviousButtonStyle CssClass="btnblue1" />
      <CancelButtonStyle CssClass="btnblue1" />
      <FinishCompleteButtonStyle CssClass="btnblue1" />
      <FinishPreviousButtonStyle CssClass="btnblue1" />
       <StartNextButtonStyle CssClass="btnblue1" />
       <WizardSteps>
            <asp:WizardStep ID="WizardStep1" runat="server" Title="客户信息">    
                <div class="inputdiv">
                <table>
                    <tr><td class="tarwCaption">客户：</td><td id="tdClient" class="tarwContent">
                            <asp:TextBox runat="server" ID="tbxClient" CssClass="inputs" autocomplete="off" disableautocomplete="true"></asp:TextBox>
                             <asp:HiddenField runat="server" ID="hdfClientID" />
                            </td><td></td></tr>
                              <tr><td>区域：</td><td id="tdRegion"> 
                              <asp:DropDownList runat="server" ID="drpRegion"></asp:DropDownList>
                        </td><td></td></tr>
                    <tr><td>城市：</td><td id="tdCity">                                               
                        <asp:TextBox runat="server" ID="tbxCity"  CssClass="inputs" autocomplete="off" disableautocomplete="true" ></asp:TextBox>
                       
                        </td><td></td></tr>
                    <tr><td>类型:</td><td>
                        <%--<asp:DropDownList runat="server" ID="drpBizType"  CssClass="select"></asp:DropDownList>--%>
                        <asp:DropDownList runat="server" ID="drpProductType"></asp:DropDownList>
                        </td><td></td></tr>
                    <tr><td>企划:</td><td id="tdPlanner"><asp:TextBox runat="server" ID="tbxPlanner"  CssClass="inputs" disableautocomplete="true"></asp:TextBox>
                        <asp:HiddenField runat="server" ID="hdfPlanner" />
                        </td><td></td></tr>
                    <tr><td>营业:</td><td id="tdSalesman"><asp:TextBox runat="server" ID="tbxSalesman"  CssClass="inputs"></asp:TextBox>
                             <asp:HiddenField runat="server" ID="hdfSalesman" />
                        </td><td></td></tr>
                    <tr><td>经营方式:</td><td><asp:DropDownList runat="server" ID="drpSaleType" CssClass="select">
                       <%-- <asp:ListItem Text="代理" Value="1"></asp:ListItem>
                         <asp:ListItem Text="直营" Value="0"></asp:ListItem>  --%>                      
                        </asp:DropDownList></td><td></td></tr>
                    <tr><td>代理商:</td><td id="tdAgentCorp"><asp:TextBox runat="server" ID="tbxAgentCorp"  CssClass="inputs"></asp:TextBox>
                         <asp:HiddenField runat="server" ID="hdfAgentCorp" />
                    </td><td></td></tr>
                    <tr><td>代理商营业:</td><td><asp:TextBox runat="server" ID="tbxAgentSalesman"  CssClass="inputs"></asp:TextBox></td><td></td></tr>
                </table>
                </div>        
            </asp:WizardStep>
            <asp:WizardStep ID="WizardStep2" runat="server" Title="商店信息">      
                 <div class="inputdiv">
                <table>
                    <tr><td class="tarwCaption">商店名称：</td><td id="tdShopName" class="tarwContent">
                        <asp:TextBox runat="server" ID="tbxShopName" CssClass="inputs"></asp:TextBox>
                        <asp:HiddenField runat="server" ID="hdfShopName" />
                        </td><td></td></tr>
                    <tr><td>商店地址：</td><td><asp:TextBox runat="server" ID="tbxAddress"  CssClass="inputs"></asp:TextBox></td><td></td></tr>
                    <tr><td>商店级别:</td><td><asp:TextBox runat="server" ID="tbxShopLev"  CssClass="inputs"></asp:TextBox></td><td></td></tr>
                    <tr><td>月均销量:</td><td><asp:TextBox runat="server" ID="tbxSaleVolume"  CssClass="inputs"></asp:TextBox></td><td></td></tr>
                    <tr><td>腾龙编码:</td><td><asp:TextBox runat="server" ID="tbxShopTLCode"  CssClass="inputs"></asp:TextBox>
                           <%-- 腾龙编码名称<asp:TextBox runat="server" ID="tbxShopInnerNum"  CssClass="inputs"></asp:TextBox>--%></td><td></td></tr>
                    <tr><td>商场面积:</td><td><asp:TextBox runat="server" ID="tbxShopSquare"  CssClass="inputs"></asp:TextBox></td><td></td></tr>
                    <tr><td>商店联系人:</td><td><asp:TextBox runat="server" ID="tbxShopLinkman"  CssClass="inputs"></asp:TextBox></td><td></td></tr>
                    <tr><td>联系电话:</td><td><asp:TextBox runat="server" ID="tbxShopLinkmanTel"  CssClass="inputs"></asp:TextBox></td><td></td></tr>
                    <tr><td>促销员:</td><td><asp:TextBox runat="server" ID="tbxShopPromotor"  CssClass="inputs"></asp:TextBox></td><td></td></tr>
                     
                </table> </div>
            </asp:WizardStep>
            <asp:WizardStep ID="WizardStep3" runat="server" Title="项目信息">   
                 <div class="inputdiv">
                   <table>
                    <tr><td class="tarwCaption">项目ID：</td><td class="tarwContent"><asp:TextBox runat="server" ID="tbxPrjID" CssClass="inputs" Enabled="false"></asp:TextBox>
                    </td><td id="tdPrjID"></td></tr>
                    <tr><td>项目名称：</td><td><asp:TextBox runat="server" ID="tbxPrjName"  CssClass="inputs"></asp:TextBox></td><td></td></tr>
                    <tr><td>项目管理人:</td><td id="tdPrjManager"><asp:TextBox runat="server" ID="tbxPrjManager"  CssClass="inputs"></asp:TextBox>
                        <asp:HiddenField runat="server" ID="hdfPrjManager" />
                    </td><td></td></tr>
                    <tr><td>预计进场时间:</td><td><asp:TextBox runat="server" ID="tbxPrjstart" CssClass="Wdate" onFocus="WdatePicker({skin:'whyGreen'})"></asp:TextBox></td><td></td></tr>
                     <tr><td>预计完工时间:</td><td><asp:TextBox runat="server" ID="tbxPrjend" CssClass="Wdate"  onFocus="WdatePicker({skin:'whyGreen',isShowClear:false,readOnly:true})"></asp:TextBox></td><td></td></tr>
                     <tr><td>紧急程度:</td><td id="tdUrgencyStatus"></td><td></td></tr>
                </table>   </div>  
            </asp:WizardStep>
             <%--  <asp:WizardStep ID="WizardStep4" runat="server" Title="完成">       
            </asp:WizardStep>     --%>
        </WizardSteps>
</asp:Wizard>
</div>
<div style="width:800px; text-align:center;">
<asp:PlaceHolder runat="server" ID="plhPreviewOrder" Visible="false">
    <div style="height:80px;padding:20px auto 30px auto;">
        <asp:Label runat="server" ID="lbSuccessful" CssClass="lbSuc"></asp:Label>
    </div>
    
     <div>
        <asp:Button runat="server" ID="btnBack" Text="返回修改" CssClass="btnblue1" />&nbsp;&nbsp;
        <asp:Button runat="server" ID="btnPreview" Text="预览"  CssClass="btnblue1" />&nbsp;&nbsp;
        <asp:Button runat="server" ID="btnList" Text="订单列表"  CssClass="btnblue1" />
    </div>
       </asp:PlaceHolder>
       </div>
<script type="text/javascript">
    $(function () {
        var PreId = "#ctl00_ContentPlaceHolder1_Wizard1_";
        var stepobj = $("input[id$=hdfCurStepIdx]");
        var stepnum = stepobj.val();
        var _cityid;
        var _options = {};
        _options.whenClickShow = true;
        loadStepView(stepnum);
        var objsidebar = $("#sideBar");
        if (objsidebar.length > 0 && parseInt(stepnum) == 0) {
            $("#tdClient").suggestShow($(PreId + "tbxClient"), $(PreId + "hdfClientID"), "/web/ServiceHandler/search.ashx?type=client", "", 13, 0, 0,"",_options)
            $("#tdCity").suggestShow($(PreId + "tbxCity"), $("input[id$=hdfCityID]"), "/web/ServiceHandler/search.ashx?type=city", "", 12, 0, 0,_options)
            $("#tdPlanner").suggestShow($(PreId + "tbxPlanner"), $(PreId + "hdfPlanner"), "/web/ServiceHandler/search.ashx?type=LinkMan&LinkManType=ClientPlanner", "", 11, 0, 0, "", _options)
            $("#tdSalesman").suggestShow($(PreId + "tbxSalesman"), $(PreId + "hdfSalesman"), "/web/ServiceHandler/search.ashx?type=LinkMan&LinkManType=ClientSalesMan", "", 10, 0, 0, "", _options)
            //debugger;
            DealShowDescription("hdfPlanner", RefreshDescription, { descrType: "<%=DescrType.LinkMan %>", container: $("#tdPlanner").next() }); //{ descrType: DescType, container: Container }
            DealShowDescription("hdfSalesman", RefreshDescription, { descrType: "<%=DescrType.LinkMan %>", container: $("#tdSalesman").next() });
            $("#tdAgentCorp").suggestShow($(PreId + "tbxAgentCorp"), $(PreId + "hdfAgentCorp"), "/web/ServiceHandler/search.ashx?type=client&clientclass=2", "", 9, 0, 0, "", _options)
        } else if (objsidebar.length > 0 && parseInt(stepnum) == 1) {
            var cityid = GetCityId();
            if (cityid) {
                $("#tdShopName").suggestShow($(PreId + "tbxShopName"), $(PreId + "hdfShopName"), "/web/ServiceHandler/search.ashx?type=shop&cityid=" + cityid, "", 2, 0, 0, "", _options);
            }
            var hdfShopName = $(PreId + "hdfShopName");
            DealShowDescription("hdfShopName", AssignShopInfo, hdfShopName[0]);
        } else if (objsidebar.length > 0 && parseInt(stepnum) == 2) {
            var tbxPrjID = $(PreId + "tbxPrjID");
            if (tbxPrjID[0].disabled) {
                if ($.trim(tbxPrjID.val()) == "") { tbxPrjID.prop("class", "inputs disableinput"); $("#tdPrjID").html("(项目ID，提交后自动生成)"); }
                if ($.trim(tbxPrjID.val()) != "") { $("#tdPrjID").html(""); }
            }
            $("#tdPrjManager").suggestShow($(PreId + "tbxPrjManager"), $(PreId + "hdfPrjManager"), "/web/ServiceHandler/search.ashx?type=prjmanager&cityid=" + GetCityId(), "", 2, 0, 0, "", _options);
            // $(PreId + "tbxPrjend").change(function () { ShowUrgency($(PreId + "tbxPrjstart").val(), $(PreId+"tbxPrjend").val(), $("#tdUrgencyStatus")); })
            // JsBindValChangeEvent($(PreId + "tbxPrjend")[0], function () { if (event.propertyName == "value") { ShowUrgency($(PreId + "tbxPrjstart").val(), $(PreId + "tbxPrjend").val(), $("#tdUrgencyStatus")); } });
            DealShowDescription("tbxPrjend", function () { ShowUrgency(new Date(), GetJSDate($(PreId + "tbxPrjend").val()), $("#tdUrgencyStatus")); });
        }
    })
    function GetCityId() {
         var cityid = $("input[id$=hdfCityID]").val(); // alert(cityid);
         if (cityid != "") {
             cityid = cityid.split(/\*/)[0];
         }
         return cityid;
     }
     function PreviewOrder() {
         var prjid = $("#ctl00_ContentPlaceHolder1_hdfPrjID").val();
         window.showModalDialog('/web/project/PrintPage/OrderDetailPrint.aspx?orderid=' + prjid+"&rdm=" + Math.random(), window, '');
     }     
</script>
</asp:Content>
